import request from '@/utils/request'
const baseUrl = '/plant/area'

export function getAreaByCompanyId (companyId) {
  return request({
    url: `${baseUrl}/listByCompanyId/${companyId}`,
    method: 'get',
  })
}

export function saveArea (data) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data: data
  })
}

export function updateArea (data) {
  return request({
    url: `${baseUrl}`,
    method: 'put',
    data:data
  })
}

export function deleteArea (ids) {
  return request({
    url: `${baseUrl}`,
    method: 'delete',
    data: ids
  })
}


export function removePlantByAreaId (areaId) {
  return request({
    url: `${baseUrl}/removePlant/${areaId}`,
    method: 'put',
  })
}
